package cn.ekuma.epos.datalogic.define.dao;

import com.openbravo.data.basic.BasicException;
import com.openbravo.data.loader.DataRead;
import com.openbravo.data.loader.DataWrite;
import com.openbravo.data.loader.Datas;
import com.openbravo.data.loader.Session;
import com.openbravo.data.loader.TableDefinition;
import com.openbravo.data.model.Field;
import com.openbravo.format.Formats;

import cn.ekuma.data.dao.BaseDAO;
import cn.ekuma.epos.symmetricds.AppConfig;
import cn.ekuma.epos.symmetricds.bean.Parameter;

public class ParameterDAO extends BaseDAO<Parameter> {

	public ParameterDAO(Session s) {
		super(s);
	}

	@Override
	public TableDefinition getTable() {
		return new TableDefinition(s,
				AppConfig.getAppProperty(AppConfig.TABLE_PREFIX)+"_"+"parameter",
                new Field[]{
                   new Field("external_id",Datas.STRING, Formats.STRING),
                   new Field("node_group_id",Datas.STRING, Formats.STRING),
                   new Field("param_key",Datas.STRING, Formats.STRING),
                   new Field("param_value",Datas.STRING, Formats.STRING),
                 },
                new int[]{0,1,2}
                );
	}
	
	/**
	 * <table name="parameter" description="Provides a way to manage most SymmetricDS settings in the database.">
        <column name="external_id" type="VARCHAR" size="50" required="true" primaryKey="true" description="Target the parameter at a specific external id. To target all nodes, use the value of 'ALL.'" />
        <column name="node_group_id" type="VARCHAR" size="50" required="true" primaryKey="true"  description="Target the parameter at a specific node group id. To target all groups, use the value of 'ALL.'"/>
        <column name="param_key" type="VARCHAR" size="80" required="true" primaryKey="true" description="The name of the parameter."/>
        <column name="param_value" type="LONGVARCHAR" description="The value of the parameter." />
    </table>
	 */

	@Override
	public void writeInsertValues(DataWrite dp, Parameter obj)
			throws BasicException {
		
	}

	@Override
	public Class getSuportClass() {
		return Parameter.class;
	}

	@Override
	public Parameter readValues(DataRead dr,Parameter obj) throws BasicException {
		// TODO Auto-generated method stub
		return null;
	}

}
